<template>
  <view class="protocol-page">
    <u-parse :html="content" :autopause="false" />
  </view>
</template>

<script>
  
  const titleObj = {
    policy: '隐私政策',
    agreement: '用户协议',
    aboutUs: '关于我们',
  }
  
  export default {
    data() {
      return {
        content: ''
      }
    },
    methods: {
      
    },
    async onLoad(options) {
      try {
        const t = options.type;
        uni.setNavigationBarTitle({
          title: titleObj[t],
        });
        const res = await this.$api.richTextApi(t);
        this.content = res.data;
      } catch (e) {
        console.log('e === ', e);
      }
    }
  }
</script>

<style lang="scss">
.protocol-page {
  padding: 12px 15px;
  box-sizing: border-box;
}
</style>
